[#ftl]
[#include "commonDef.ftl" /]
[#assign toggleFlag=(data_main.fieldEx['toggleFlag']!'') oData = (other?? && toggleFlag?length>0)?then(other[toggleFlag],'') /]
import request from '@/utils/request'

[@ApiUrlHandler data_main=data_main data_method=data_method /][#--  主(左)--]

[#if toggleFlag?length>0]
[@ApiUrlHandler data_main=oData.data_main data_method=oData.data_method /][#--  子(右)--]
[/#if]

[#macro ApiUrlHandler data_main data_method]
[#list data_method as mdx]
[#if mdx.needFlag == '1']
//${ControllerMethodTitle(data_main,mdx)}
export function ${ControllerMethodName(data_main,mdx)}(data) {
  return request({
    url: '${MethodUrlFunc(data_main,mdx)}',
    method: '${(mdx.fieldEx['requestType']!"post")?lower_case}',
    ${((mdx.fieldEx['requestType']!"post")?lower_case=="get")?then("params","data")}: data
  })
}

[/#if]
[/#list]
[/#macro]

